<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// The Pligg Team <pligger at pligg dot com>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

class SidebarUsers {
  var $pagesize = 5; // The number of items to show
  var $orderBy = ""; // The sorting order
  var $header = ""; // The text to show at the top
  var $template = ""; // The template to use, including folder
  var $TitleLengthLimit = '';
  
	function show($fetch = false) {
		global $main_smarty, $db, $cached_links, $current_user;
		
		$reco_sqlquery = "SELECT * from " . table_users . " WHERE user_first_time = 'false' ORDER BY user_date DESC LIMIT 0,5";
		$reco_searchsql = mysql_query($reco_sqlquery);
		$reco_userlist = array();
		while ($row = mysql_fetch_array ($reco_searchsql, MYSQL_ASSOC)) array_push ($reco_userlist, $row);
		foreach($reco_userlist as $key => $val){
			$reco_userlist[$key]['Avatar'] = get_avatar('large', "", $val['user_login'], $val['user_email']);
		}
		$main_smarty->assign('reco_userlist', $reco_userlist);
		
		$ssLinks = '';
		$ssLinks .= $main_smarty->fetch($this->template);
		if($fetch == true){
			return $ssLinks;
		} else {
			echo $ssLinks;
		}
	}
}
?>
